package com.jic.market;

import com.github.xiaoymin.swaggerbootstrapui.annotations.EnableSwaggerBootstrapUI;
import com.jic.common.swagger.config.Swagger2Config;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * @author: gaoly
 * @date: 2019/11/21
 * @remark:     swagger地址为:http://127.0.0.1:8088/jic-market/swagger-ui.html#/
        */
@SpringBootApplication
//@EnableEurekaClient

@EnableSwagger2
@MapperScan("com.jic.market.mapper")
@EnableCaching
@ServletComponentScan
@EnableFeignClients(basePackages = {"com.jic.manager.api","com.jic.product.after.api","com.jic.member.api","com.jic.member.provider.service","com.jic.order.api"})
@EnableSwaggerBootstrapUI
@EnableDiscoveryClient
public class JicMarketImplApplication {
    public static void main(String[] args) {
        SpringApplication.run(JicMarketImplApplication.class, args);
    }

    @Bean
    @ConditionalOnMissingBean
    public Docket getDocket(){
        return new Swagger2Config().createRestApi(this.getClass().getSimpleName());
    }

}
